<include file="./Application/Admin/View/Public/htmlheader.html"/>
<include file="./Application/Admin/View/Public/header.html"/>
<include file="./Application/Admin/View/Public/left.html"/>

<ol class="breadcrumb">
    <li><a href="/Admin">首页</a></li>
    <li class="active">权限组</li>
</ol>

<div class="row">
    <div class="col-lg-12">
        <div class="table-responsive">
            <table class="table table-hover table-bordered">
                <tr class="success">
                    <th>名称</th>
                    <th>描述</th>
                    <th width="50%">所属功能</th>
                    <th>系统组</th>
                    <th>状态</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                <volist name="groupList" id="vo" empty="暂时没有数据">
                    <tr>
                        <td>{$vo.name}</td>
                        <td>{$vo.description}</td>
                        <td>{$vo.functions}</td>
                        <td>
                            <if condition="$vo.isSystem eq 0">否</if>
                            <if condition="$vo.isSystem eq 1">是</if>
                        </td>
                        <td>
                            <if condition="$vo.status eq 0"><span class="red">禁用</span></if>
                            <if condition="$vo.status eq 1"><span class="green">正常</span></if>
                        </td>
                        <td>{$vo.createTime}</td>
                        <td>
                            <if condition="$permission['edit'] eq TRUE">
                                <a href="/Admin/UserGroup/edit/id/{$vo.id}" class="btn btn-info btn-xs">编辑</a>
                            </if>
                            <if condition="$permission['del'] eq TRUE">
                            <a href="/Admin/UserGroup/del/id/{$vo.id}" onclick="return confirm('确定删除?');"
                               class="btn btn-danger btn-xs">删除</a>
                            </if>
                        </td>
                    </tr>
                </volist>
            </table>
            <div class="row">
                <div class="col-lg-3">
                    <if condition="$permission['add'] eq TRUE">
                    <button class="btn btn-primary" data-toggle="modal" data-target="#addGroup">添加权限组</button>
                    </if>
                </div>
                <div class="col-lg-9 text-center">
                    <nav>{$page}</nav>
                </div>
            </div>
        </div>
    </div>
</div>

<!--   添加权限组 弹出层   -->
<div class="modal fade" id="addGroup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">添加权限组</h4>
            </div>
            <form action="__ROOT__/Admin/UserGroup/add" method="post">
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>名称：</p></div>
                        <div class="col-lg-9"><input type="text" name="name" class="form-control"/></div>
                    </div>
                    <br/>
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>描述：</p></div>
                        <div class="col-lg-9"><input type="text" name="description" class="form-control"/></div>
                    </div>
                    <br/>
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>所属功能：</p></div>
                        <div class="col-lg-9">
                            <volist name="functions" id="vo">
                                <div class="functionBox">
                                    <div class="functionStyle clear"><b>{$vo.name}</b></div>
                                    <ul class="functionList">
                                        <volist name="vo['child']" id="voo">
                                            <li><input type="checkbox" name="functionId[]" value="{$voo.id}"/>{$voo.name}
                                            </li>
                                        </volist>
                                    </ul>
                                </div>
                            </volist>
                        </div>
                    </div>
                    <br/>
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>系统组：</p></div>
                        <div class="col-lg-9">
                            <select name="isSystem" class="form-control">
                                <option value="0">否</option>
                                <option value="1">是</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">确认</button>
                </div>
            </form>
        </div>
    </div>
</div>

<include file="./Application/Admin/View/Public/footer.html"/>